This is a brief workflow highlighting the exploratory analysis of survey data mined to assist in the writing of the manuscript, “Gender Disparities Persist in Endoscopy Suite” (Rabinowitz, et al.). Where appropriate, samples of the exact R syntax used will be displayed, along with the corresponding output (tabular data, graphical plots, maps, etc.).
require(broom)
require(dplyr)
SURVEY <-
GENDER_DIFF_DATA_LABELS %>%
filter( COMPLETE != "Incomplete" &
BIRTHSEX != "OTHER" &
!is.na(BIRTHSEX) ) %>%
select( RECORD_ID, BIRTHSEX, RACE_SOUTHASIAN:RACE_OTHER, AGE, TRAINING_LEVEL, HEIGHT, GLOVE, GLOVE_SIZE_AVAILABLE, PERFORMANCE_HOURS, TEACHER_GENDER_PREFERENCE,
FEMALE_TRAINERS, MALE_TRAINERS, EVER_INJURED, EXPERIENCED_TRANSIENT_PAIN_NO, EXPERIENCED_TRANSIENT_PAIN_HAND, EXPERIENCED_TRANSIENT_PAIN_NECK_SHOULDER,
EXPERIENCED_TRANSIENT_PAIN_BACK, EXPERIENCED_TRANSIENT_PAIN_LEG, EXPERIENCED_TRANSIENT_PAIN_FOOT, GROWING_PAINS,
FELLOWSHIP_FORMAL_ERGO_TRAINING, INFORMAL_TRAINING, TRAINING_TECHNIQUES_POSTURAL, TRAINING_TECHNIQUES_BEDHEIGHT, TRAINING_TECHNIQUES_BEDANGLE,
TRAINING_TECHNIQUES_MONITORHEIGHT, TRAINING_TECHNIQUES_MUSCULOSKELETAL, TRAINING_TECHNIQUES_EXERCISE_STRETCHING, TRAINING_TECHNIQUES_DIAL_EXTENDERS,
TRAINING_TECHNIQUES_PEDIATRIC_COLONOSCOPE, ERGO_TRAINING_BUDGET, ERGO_FEEDBACK, ERGO_FEEDBACK_BY_WHOM, ERGO_OPTIMIZATION, GLOVE_SIZE_AVAILABLE,
DIAL_EXTENDERS_AVAILABLE, DIAL_EXTENDERS_ENCOURAGED, DIAL_EXTENDERS_FEMALEATT, DIAL_EXTENDERS_MALEATT, PEDI_COLONOSCOPES_AVAILABLE,
LEAD_APRONS_DONTKNOW, LEAD_APRONS_LW_ONEPIECE, LEAD_APRONS_LW_TWOPIECE, LEAD_APRONS_STANDARD_ONEPIECE, LEAD_APRONS_STANDARD_TWOPIECE,
LEAD_APRONS_DOUBLE, LEAD_APRONS_THYROID, LEAD_APRONS_MATERNALDOS, LEAD_APRONS_FETALDOS,
ERGO_FORMAL_TIMEOUT_PRIOR, ERGO_INFORMAL_TIMEOUT_PRIOR, MONITORS_ADJUSTABLE, TEACHER_SENSITIVITY_STATURE_HANDSIZE,
TEACHER_SENSITIVITY_BY_GENDER, TACTILE_INSTRUCTION_FROM_MALES, TACTILE_INSTRUCTION_FROM_FEMALES,
COMFORTABLE_ASKING_NURSES, ASK_NURSES_ONCE, ASK_NURSES_TWICE, ASK_NURSES_MORE,
COMFORTABLE_ASKING_TECHS, MALE_ATTENDINGS_ASKING, FEMALE_ATTENDINGS_ASKING,
RECOGNIZED_RESPECTED_ES_STAFF, RECOGNIZED_RESPECTED_ANESTHETISTS, RECOGNIZED_RESPECTED_GASTRO_ATTENDING, FIRST_NAME_NO_PERMISSION,
ERGO_TRAINING_MANDATORY, ERGO_OPTIMIZAITON_BUDGET_REQUIRED, EXPERIENCE_IMPROVED_DIAL_EXTENDERS, EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES, EXPERIENCE_IMPROVED_APRONS,
ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED,
ERGONOMIC_IMPORTANCE, MITIGATING_MUSCLE_STRAIN, BED_POSITION, ENDO_TRAINER_POSITION, WHEN_DISABILITY_INSURANCE) %>%
mutate(AGE2 = ifelse( AGE %in% c('< 30', '30-34', '35-40'), AGE, '> 40' )) %>%
mutate( RACE = ifelse( RACE_HISPANIC == "Y", "HISPANIC",
ifelse( RACE_WHITE == "Y", "WHITE",
ifelse( RACE_BLACK == "Y", "BLACK",
ifelse (RACE_SOUTHASIAN == "Y", "ASIAN SOUTH",
ifelse (RACE_EASTASIAN == "Y", "ASIAN EAST",
ifelse (RACE_NATIVEAMER == "Y", "OTHER",
ifelse (RACE_PACIFICISLAND == "Y", "OTHER",
ifelse (RACE_OTHER == "Y", "OTHER", "OTHER" )))))))),
RACE = factor(RACE, levels= c('ASIAN EAST', 'ASIAN SOUTH', 'BLACK', 'HISPANIC', 'WHITE', 'OTHER'))) %>%
mutate( BIRTHSEX = factor( BIRTHSEX, levels= c("F","M") )) %>%
mutate (AGE2 = factor(AGE2, levels = c('< 30', '30-34', '35-40', '> 40'))) %>%
mutate (RACE2 = case_when( RACE != "WHITE" ~ 'NON-WHITE',
TRUE ~ 'WHITE'),
RACE2 = factor(RACE2, levels = c("WHITE", "NON-WHITE"))) %>%
mutate( TRAINING_LEVEL = factor (TRAINING_LEVEL, levels= c('First year fellow','Second year fellow', 'Third year fellow', 'Advanced fellow'))) %>%
mutate( TRAINING_LEVEL = recode_factor( TRAINING_LEVEL, 'First year fellow'= 'First Year',
'Second year fellow'= 'Second Year',
'Third year fellow' = 'Third Year',
'Advanced fellow' = "Avanced", .ordered = T) ) %>%
mutate( HEIGHT2 = factor(HEIGHT, levels= c("< 5'", "5-5'3", "5'4-5'6", "5'7-5'9", "5'10-6'", "6'1-6'4", "> 6'4"))) %>%
mutate( PERFORMANCE_HOURS = factor(PERFORMANCE_HOURS),
PERFORMANCE_HOURS = recode_factor(PERFORMANCE_HOURS, "< 10" = "< 10",
"10-20" = "10-20",
"21-30" = "21-30",
"31-40" = "31-40",
.default = "> 40")) %>%
mutate(TEACHER_GENDER_PREFERENCE = factor(TEACHER_GENDER_PREFERENCE),
TEACHER_GENDER_PREFERENCE = recode_factor(TEACHER_GENDER_PREFERENCE, "Yes" = "Yes",
.default = "No")) %>%
mutate( FEMALE_TRAINERS = factor(FEMALE_TRAINERS),
FEMALE_TRAINERS = recode_factor(FEMALE_TRAINERS, 'None' = 'None',
'1-2' = '1-2',
'3-5' = '3-5',
'6-10' = '6-10',
'> 10' = '> 10' )) %>%
mutate( MALE_TRAINERS = factor(MALE_TRAINERS),
MALE_TRAINERS = recode_factor(MALE_TRAINERS, 'None' = 'None',
'1-2' = '1-2',
'3-5' = '3-5',
'6-10' = '6-10',
'> 10' = '> 10' )) %>%
mutate( EVER_INJURED = factor(EVER_INJURED)) %>%
mutate( EXPERIENCED_TRANSIENT_PAIN_NO = factor(EXPERIENCED_TRANSIENT_PAIN_NO)) %>%
mutate( EXPERIENCED_TRANSIENT_PAIN_HAND = factor(EXPERIENCED_TRANSIENT_PAIN_HAND)) %>%
mutate( EXPERIENCED_TRANSIENT_PAIN_NECK_SHOULDER = factor(EXPERIENCED_TRANSIENT_PAIN_NECK_SHOULDER)) %>%
mutate( EXPERIENCED_TRANSIENT_PAIN_BACK = factor(EXPERIENCED_TRANSIENT_PAIN_BACK)) %>%
mutate( EXPERIENCED_TRANSIENT_PAIN_LEG = factor(EXPERIENCED_TRANSIENT_PAIN_LEG)) %>%
mutate( EXPERIENCED_TRANSIENT_PAIN_FOOT = factor(EXPERIENCED_TRANSIENT_PAIN_FOOT)) %>%
mutate( GROWING_PAINS = factor(GROWING_PAINS)) %>%
mutate( FELLOWSHIP_FORMAL_ERGO_TRAINING = factor(FELLOWSHIP_FORMAL_ERGO_TRAINING)) %>%
mutate( INFORMAL_TRAINING = factor(INFORMAL_TRAINING)) %>%
mutate( TRAINING_TECHNIQUES_POSTURAL = factor(TRAINING_TECHNIQUES_POSTURAL)) %>%
mutate( TRAINING_TECHNIQUES_BEDHEIGHT = factor(TRAINING_TECHNIQUES_BEDHEIGHT)) %>%
mutate( TRAINING_TECHNIQUES_BEDANGLE = factor(TRAINING_TECHNIQUES_BEDANGLE)) %>%
mutate( TRAINING_TECHNIQUES_MONITORHEIGHT = factor(TRAINING_TECHNIQUES_MONITORHEIGHT)) %>%
mutate( TRAINING_TECHNIQUES_MUSCULOSKELETAL = factor(TRAINING_TECHNIQUES_MUSCULOSKELETAL)) %>%
mutate( TRAINING_TECHNIQUES_EXERCISE_STRETCHING = factor(TRAINING_TECHNIQUES_EXERCISE_STRETCHING)) %>%
mutate( TRAINING_TECHNIQUES_DIAL_EXTENDERS = factor(TRAINING_TECHNIQUES_DIAL_EXTENDERS)) %>%
mutate( TRAINING_TECHNIQUES_PEDIATRIC_COLONOSCOPE = factor(TRAINING_TECHNIQUES_PEDIATRIC_COLONOSCOPE)) %>%
mutate( ERGO_TRAINING_BUDGET = factor(ERGO_TRAINING_BUDGET),
ERGO_TRAINING_BUDGET = recode_factor(ERGO_TRAINING_BUDGET, 'Yes' = 'Y',
'No' = 'N',
"Don't know" = 'DK', .ordered= T)) %>%
mutate( ERGO_FEEDBACK = factor(ERGO_FEEDBACK),
ERGO_FEEDBACK = recode_factor(ERGO_FEEDBACK, 'Never' = 'Never',
'Rarely' = 'Rarely',
'Sometimes' = 'Sometimes',
'Often' = 'Often', .ordered = T )) %>%
mutate( ERGO_FEEDBACK_BY_WHOM = factor(ERGO_FEEDBACK_BY_WHOM),
ERGO_FEEDBACK_BY_WHOM = recode_factor(ERGO_FEEDBACK_BY_WHOM, 'I do not or rarely receive ergonomic feedback' = "Do not/rarely received feedback",
'Mostly male endoscopy teachers' = 'Mostly male teachers',
'Mostly female endoscopy teachers' = 'Mostly female teachers',
'Both male and female endoscopy teachers equally' = 'Both equally' , .ordered = T)) %>%
mutate( ERGO_OPTIMIZATION = factor(ERGO_OPTIMIZATION),
ERGO_OPTIMIZATION = recode_factor(ERGO_OPTIMIZATION, 'Y' = 'Y',
'N' = 'N',
"Don't know" = 'DK', .ordered= T)) %>%
mutate( GLOVE_SIZE_AVAILABLE = factor(GLOVE_SIZE_AVAILABLE)) %>%
mutate( DIAL_EXTENDERS_AVAILABLE = factor(DIAL_EXTENDERS_AVAILABLE),
DIAL_EXTENDERS_AVAILABLE = recode_factor(DIAL_EXTENDERS_AVAILABLE, 'Y' = 'Y',
'N' = 'N',
"Don't know" = 'DK', .ordered= T)) %>%
mutate( DIAL_EXTENDERS_ENCOURAGED = factor(DIAL_EXTENDERS_ENCOURAGED),
DIAL_EXTENDERS_ENCOURAGED = recode_factor(DIAL_EXTENDERS_ENCOURAGED, 'Y' = 'Y',
'N' = 'N',
"Don't use" = 'DU', .ordered= T)) %>%
mutate( DIAL_EXTENDERS_FEMALEATT = factor(DIAL_EXTENDERS_FEMALEATT),
DIAL_EXTENDERS_FEMALEATT = recode_factor(DIAL_EXTENDERS_FEMALEATT, 'Not Likely' = 'Not Likely',
'Somewhat Likely' = 'Somewhat Likely',
'Sometimes' = 'Sometimes',
'Verly Likely' = 'Very Likely',
'NA' = 'NA', .ordered = T )) %>%
mutate( DIAL_EXTENDERS_MALEATT = factor(DIAL_EXTENDERS_MALEATT),
DIAL_EXTENDERS_MALEATT = recode_factor(DIAL_EXTENDERS_MALEATT, 'Not Likely' = 'Not Likely',
'Somewhat Likely' = 'Somewhat Likely',
'Sometimes' = 'Sometimes',
'Verly Likely' = 'Very Likely',
'NA' = 'NA', .ordered = T )) %>%
mutate( PEDI_COLONOSCOPES_AVAILABLE = factor(PEDI_COLONOSCOPES_AVAILABLE),
PEDI_COLONOSCOPES_AVAILABLE = recode_factor(PEDI_COLONOSCOPES_AVAILABLE, 'Y' = 'Y',
'N' = 'N',
"Don't know" = 'DK', .ordered= T)) %>%
mutate( LEAD_APRONS_DONTKNOW = factor(LEAD_APRONS_DONTKNOW),
LEAD_APRONS_DONTKNOW = recode_factor(LEAD_APRONS_DONTKNOW, 'N' = 'Aware',
'Y' = 'Not Aware',.ordered= T)) %>%
mutate( TEACHER_SENSITIVITY_BY_GENDER = factor(TEACHER_SENSITIVITY_BY_GENDER),
TEACHER_SENSITIVITY_BY_GENDER = recode_factor(TEACHER_SENSITIVITY_BY_GENDER, 'Male' = 'Male',
'Female' = 'Female',
'Both equally' = 'Both Equally',
'I have not had female endoscopy teachers' = 'Never had female teacher',
'Not sure' = 'Not Sure', .ordered= T )) %>%
mutate( TACTILE_INSTRUCTION_FROM_MALES = factor(TACTILE_INSTRUCTION_FROM_MALES),
TACTILE_INSTRUCTION_FROM_MALES = recode_factor(TACTILE_INSTRUCTION_FROM_MALES, 'No' = 'No',
'Yes, rarely' = 'Rarely',
'Yes, often' = 'Often', .ordered= T)) %>%
mutate( TACTILE_INSTRUCTION_FROM_FEMALES = factor(TACTILE_INSTRUCTION_FROM_FEMALES),
TACTILE_INSTRUCTION_FROM_FEMALES = recode_factor(TACTILE_INSTRUCTION_FROM_FEMALES, 'No' = 'No',
'Yes, rarely' = 'Rarely',
'Yes, often' = 'Often', .ordered= T)) %>%
mutate( NURSES_ASKING = ifelse( ASK_NURSES_MORE == "Y", "More than Twice",
ifelse( ASK_NURSES_TWICE == "Y", "Twice",
ifelse( ASK_NURSES_ONCE == "Y", "Once", NA))),
NURSES_ASKING = factor(NURSES_ASKING),
NURSES_ASKING = recode_factor(NURSES_ASKING, "Once" = "Once",
"Twice" = "Twice",
"More than Twicce" = "More than Twice", .ordered=T),
MALE_ATTENDINGS_ASKING = factor(MALE_ATTENDINGS_ASKING),
MALE_ATTENDINGS_ASKING = recode_factor(MALE_ATTENDINGS_ASKING, "Once" = "Once",
"Twice" = "Twice",
"More than Twice" = "More than Twice", .ordered=T),
FEMALE_ATTENDINGS_ASKING = factor(FEMALE_ATTENDINGS_ASKING),
FEMALE_ATTENDINGS_ASKING = recode_factor(FEMALE_ATTENDINGS_ASKING, "Once" = "Once",
"Twice" = "Twice",
"More than twice" = "More than Twice",
"Not applicable, I do not work with any female attendings" = "Don't work with FemAtt", .ordered=T)) %>%
mutate( ERGO_TRAINING_MANDATORY = factor(ERGO_TRAINING_MANDATORY),
ERGO_TRAINING_MANDATORY = recode_factor(ERGO_TRAINING_MANDATORY, 'Y' = 'Y',
'N' = 'N',
"Don't know" = 'DK', .ordered= T) ,
ERGO_OPTIMIZAITON_BUDGET_REQUIRED = factor(ERGO_OPTIMIZAITON_BUDGET_REQUIRED),
ERGO_OPTIMIZAITON_BUDGET_REQUIRED = recode_factor(ERGO_OPTIMIZAITON_BUDGET_REQUIRED, 'Y' = 'Y',
'N' = 'N',
"Don't know" = 'DK', .ordered= T),
EXPERIENCE_IMPROVED_DIAL_EXTENDERS = factor(EXPERIENCE_IMPROVED_DIAL_EXTENDERS),
EXPERIENCE_IMPROVED_DIAL_EXTENDERS = recode_factor(EXPERIENCE_IMPROVED_DIAL_EXTENDERS, 'Y' = 'Y',
'N' = 'N',
"Don't know" = 'DK', .ordered= T),
EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES = factor(EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES),
EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES = recode_factor(EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES, 'Y' = 'Y',
'N' = 'N',
"Don't know" = 'DK', .ordered= T) ,
EXPERIENCE_IMPROVED_APRONS = factor(EXPERIENCE_IMPROVED_APRONS),
EXPERIENCE_IMPROVED_APRONS = recode_factor(EXPERIENCE_IMPROVED_APRONS, 'Y' = 'Y',
'N' = 'N',
"Don't know" = 'DK', .ordered= T),
ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED = factor(ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED),
ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED = recode_factor(ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED, 'Y' = 'Y',
'N' = 'N',
"Don't know" = 'DK', .ordered= T)) %>%
mutate( ERGONOMIC_IMPORTANCE = factor(ERGONOMIC_IMPORTANCE),
ERGONOMIC_IMPORTANCE = recode_factor(ERGONOMIC_IMPORTANCE, 'Both A and C' = 'Correct',
.default = 'Incorrect', .ordered= T) ,
MITIGATING_MUSCLE_STRAIN = factor(MITIGATING_MUSCLE_STRAIN),
MITIGATING_MUSCLE_STRAIN = recode_factor(MITIGATING_MUSCLE_STRAIN, 'All of the above' = 'Correct',
.default = 'Incorrect', .ordered= T) ,
BED_POSITION = factor(BED_POSITION),
BED_POSITION = recode_factor(BED_POSITION, '10 cm below elbow height' = 'Correct',
.default = 'Incorrect', .ordered= T) ,
ENDO_TRAINER_POSITION = factor(ENDO_TRAINER_POSITION),
ENDO_TRAINER_POSITION = recode_factor(ENDO_TRAINER_POSITION, 'At the foot of the bed, on the same side of the trainee.' = 'Correct',
.default = 'Incorrect', .ordered= T) ,
WHEN_DISABILITY_INSURANCE = factor(WHEN_DISABILITY_INSURANCE),
WHEN_DISABILITY_INSURANCE = recode_factor(WHEN_DISABILITY_INSURANCE, 'During training' = 'Correct',
.default = 'Incorrect', .ordered= T) )
Here’s a glimpse of the structure of the resulting dataset
SURVEY:
glimpse(SURVEY)
## Rows: 200
## Columns: 89
## $ RECORD_ID <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 1…
## $ BIRTHSEX <fct> F, F, F, M, F, F, F, F, F, M…
## $ RACE_SOUTHASIAN <chr> "N", "N", "N", "Y", "N", "N"…
## $ RACE_EASTASIAN <chr> "N", "N", "N", "N", "Y", "Y"…
## $ RACE_WHITE <chr> "N", "Y", "Y", "N", "N", "N"…
## $ RACE_BLACK <chr> "N", "N", "N", "N", "N", "N"…
## $ RACE_HISPANIC <chr> "Y", "N", "N", "N", "N", "N"…
## $ RACE_NATIVEAMER <chr> "N", "N", "N", "N", "N", "N"…
## $ RACE_PACIFICISLAND <chr> "N", "N", "N", "N", "N", "N"…
## $ RACE_OTHER <chr> "N", "N", "N", "N", "N", "N"…
## $ AGE <chr> "30-34", "30-34", "30-34", "…
## $ TRAINING_LEVEL <ord> Third Year, Third Year, Firs…
## $ HEIGHT <chr> "5'4-5'6", "5'4-5'6", "5'4-5…
## $ GLOVE <dbl> 6.5, 6.5, 6.0, 7.0, 6.5, 5.5…
## $ GLOVE_SIZE_AVAILABLE <fct> Y, Y, Y, Y, N, N, Y, Y, N, Y…
## $ PERFORMANCE_HOURS <fct> 10-20, < 10, 10-20, 31-40, 1…
## $ TEACHER_GENDER_PREFERENCE <fct> No, No, Yes, No, No, No, No,…
## $ FEMALE_TRAINERS <fct> None, 6-10, 6-10, 6-10, 6-10…
## $ MALE_TRAINERS <fct> 6-10, > 10, > 10, > 10, > 10…
## $ EVER_INJURED <fct> N, N, N, N, Y, N, N, N, N, N…
## $ EXPERIENCED_TRANSIENT_PAIN_NO <fct> Y, N, N, N, N, N, N, N, N, N…
## $ EXPERIENCED_TRANSIENT_PAIN_HAND <fct> N, Y, Y, Y, Y, Y, Y, N, N, Y…
## $ EXPERIENCED_TRANSIENT_PAIN_NECK_SHOULDER <fct> N, Y, Y, Y, Y, N, Y, Y, Y, Y…
## $ EXPERIENCED_TRANSIENT_PAIN_BACK <fct> N, Y, Y, Y, Y, N, Y, N, N, Y…
## $ EXPERIENCED_TRANSIENT_PAIN_LEG <fct> N, N, Y, Y, N, N, N, N, N, N…
## $ EXPERIENCED_TRANSIENT_PAIN_FOOT <fct> N, N, Y, Y, N, Y, N, N, N, N…
## $ GROWING_PAINS <fct> NA, Y, Y, Y, Y, N, N, Y, N, …
## $ FELLOWSHIP_FORMAL_ERGO_TRAINING <fct> N, N, N, N, N, N, N, Y, N, Y…
## $ INFORMAL_TRAINING <fct> Y, Y, Y, Y, Y, Y, N, Y, Y, Y…
## $ TRAINING_TECHNIQUES_POSTURAL <fct> Y, N, Y, Y, N, Y, Y, Y, N, Y…
## $ TRAINING_TECHNIQUES_BEDHEIGHT <fct> Y, Y, Y, Y, Y, Y, Y, Y, Y, Y…
## $ TRAINING_TECHNIQUES_BEDANGLE <fct> Y, N, Y, Y, N, Y, Y, N, Y, Y…
## $ TRAINING_TECHNIQUES_MONITORHEIGHT <fct> Y, N, N, Y, N, Y, Y, N, Y, Y…
## $ TRAINING_TECHNIQUES_MUSCULOSKELETAL <fct> Y, N, N, Y, N, N, N, Y, Y, N…
## $ TRAINING_TECHNIQUES_EXERCISE_STRETCHING <fct> N, N, N, N, N, N, N, N, N, N…
## $ TRAINING_TECHNIQUES_DIAL_EXTENDERS <fct> N, N, Y, N, Y, N, Y, N, N, N…
## $ TRAINING_TECHNIQUES_PEDIATRIC_COLONOSCOPE <fct> Y, N, Y, Y, Y, N, Y, Y, Y, N…
## $ ERGO_TRAINING_BUDGET <ord> DK, N, DK, DK, N, DK, DK, N,…
## $ ERGO_FEEDBACK <ord> Sometimes, Rarely, Sometimes…
## $ ERGO_FEEDBACK_BY_WHOM <ord> Mostly male teachers, Mostly…
## $ ERGO_OPTIMIZATION <ord> DK, N, N, Y, N, N, Y, DK, N,…
## $ DIAL_EXTENDERS_AVAILABLE <ord> DK, N, Y, Y, Y, N, Y, DK, N,…
## $ DIAL_EXTENDERS_ENCOURAGED <ord> DU, N, Y, Y, Y, DU, Y, NA, N…
## $ DIAL_EXTENDERS_FEMALEATT <ord> NA, NA, Not likely, NA, Very…
## $ DIAL_EXTENDERS_MALEATT <ord> NA, NA, Very likely, NA, Ver…
## $ PEDI_COLONOSCOPES_AVAILABLE <ord> Y, Y, Y, Y, Y, Y, Y, Y, Y, Y…
## $ LEAD_APRONS_DONTKNOW <ord> Aware, Aware, Not Aware, Awa…
## $ LEAD_APRONS_LW_ONEPIECE <chr> "N", "N", "N", "Y", "N", "Y"…
## $ LEAD_APRONS_LW_TWOPIECE <chr> "Y", "N", "N", "Y", "N", "Y"…
## $ LEAD_APRONS_STANDARD_ONEPIECE <chr> "N", "Y", "N", "Y", "N", "Y"…
## $ LEAD_APRONS_STANDARD_TWOPIECE <chr> "N", "Y", "N", "Y", "N", "Y"…
## $ LEAD_APRONS_DOUBLE <chr> "N", "N", "N", "N", "N", "N"…
## $ LEAD_APRONS_THYROID <chr> "N", "N", "N", "Y", "N", "N"…
## $ LEAD_APRONS_MATERNALDOS <chr> "N", "N", "N", "N", "N", "N"…
## $ LEAD_APRONS_FETALDOS <chr> "N", "N", "N", "N", "N", "N"…
## $ ERGO_FORMAL_TIMEOUT_PRIOR <chr> "N", "N", "N", "N", "N", "N"…
## $ ERGO_INFORMAL_TIMEOUT_PRIOR <chr> "Y", "N", "Y", "Y", "Y", "Y"…
## $ MONITORS_ADJUSTABLE <chr> "Y", "N", "N", "Y", "N", "Y"…
## $ TEACHER_SENSITIVITY_STATURE_HANDSIZE <chr> "Y", "N", "N", "Y", "N", "N"…
## $ TEACHER_SENSITIVITY_BY_GENDER <ord> Never had female teacher, No…
## $ TACTILE_INSTRUCTION_FROM_MALES <ord> Often, No, No, No, No, No, O…
## $ TACTILE_INSTRUCTION_FROM_FEMALES <ord> No, No, No, Rarely, Rarely, …
## $ COMFORTABLE_ASKING_NURSES <chr> "Y", "Y", "Y", "Y", "Y", "Y"…
## $ ASK_NURSES_ONCE <chr> "Y", "Y", "N", "N", "N", "Y"…
## $ ASK_NURSES_TWICE <chr> "N", "N", "Y", "N", "N", "N"…
## $ ASK_NURSES_MORE <chr> "N", "N", "N", "Y", "Y", "N"…
## $ COMFORTABLE_ASKING_TECHS <chr> "Y", "Y", "Y", "Y", "Y", "Y"…
## $ MALE_ATTENDINGS_ASKING <ord> Once, NA, More than twice, M…
## $ FEMALE_ATTENDINGS_ASKING <ord> Don't work with FemAtt, NA, …
## $ RECOGNIZED_RESPECTED_ES_STAFF <chr> "Y", "Y", "Y", "Y", "Y", "Y"…
## $ RECOGNIZED_RESPECTED_ANESTHETISTS <chr> "Y", "Y", "Y", "Y", "Y", "N"…
## $ RECOGNIZED_RESPECTED_GASTRO_ATTENDING <chr> "Y", "Y", "Y", "Y", "Y", "Y"…
## $ FIRST_NAME_NO_PERMISSION <chr> "N", "Y", "Y", "N", "N", "Y"…
## $ ERGO_TRAINING_MANDATORY <ord> Y, Y, Y, Y, Y, Y, Y, Y, Y, Y…
## $ ERGO_OPTIMIZAITON_BUDGET_REQUIRED <ord> Y, Y, Y, Y, Y, Y, Y, Y, Y, Y…
## $ EXPERIENCE_IMPROVED_DIAL_EXTENDERS <ord> DK, DK, Y, N, Y, Y, Y, DK, Y…
## $ EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES <ord> DK, N, Y, N, Y, Y, Y, N, Y, …
## $ EXPERIENCE_IMPROVED_APRONS <ord> N, Y, Y, N, Y, Y, Y, DK, Y, …
## $ ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED <ord> Y, Y, Y, Y, Y, Y, Y, Y, Y, Y…
## $ ERGONOMIC_IMPORTANCE <ord> Incorrect, Correct, Correct,…
## $ MITIGATING_MUSCLE_STRAIN <ord> Incorrect, Correct, Correct,…
## $ BED_POSITION <ord> Incorrect, Incorrect, Correc…
## $ ENDO_TRAINER_POSITION <ord> Incorrect, Correct, Incorrec…
## $ WHEN_DISABILITY_INSURANCE <ord> Incorrect, Correct, Correct,…
## $ AGE2 <fct> 30-34, 30-34, 30-34, 30-34, …
## $ RACE <fct> HISPANIC, WHITE, WHITE, ASIA…
## $ RACE2 <fct> NON-WHITE, WHITE, WHITE, NON…
## $ HEIGHT2 <fct> 5'4-5'6, 5'4-5'6, 5'4-5'6, 6…
## $ NURSES_ASKING <ord> Once, Once, Twice, More than…
#Female/Male Totals
sqldf("select BIRTHSEX,
count(RECORD_ID) as N
from SURVEY
where BIRTHSEX in ('F','M')
group by 1")
## BIRTHSEX N
## 1 F 99
## 2 M 101
#Chi-Square Test of Proportions
fcount <- length(SURVEY$BIRTHSEX[SURVEY$BIRTHSEX =="F"])
mcount <- length(SURVEY$BIRTHSEX[SURVEY$BIRTHSEX =="M"])
fcount
## [1] 99
mcount
## [1] 101
females_males = c(fcount, mcount )
chisq.test(females_males, p= c(1/2, 1/2))
##
## Chi-squared test for given probabilities
##
## data: females_males
## X-squared = 0.02, df = 1, p-value = 0.8875
#SJPlot cross tabulation with Chi-Square/df
plot_xtab(SURVEY$AGE2, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Age Distribution by Birth Sex",
axis.titles = c('Respondents Age Bands'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
SUBSET2 <-
SURVEY %>%
filter( !is.na(AGE2)) %>%
mutate(BIRTHSEX = recode_factor( BIRTHSEX, "M" = "MALES", "F" = "FEMALES", .ordered=T))
ggplot( SUBSET2, aes(x= AGE2)) + facet_grid( SUBSET2$BIRTHSEX ) +
geom_bar(aes(fill= BIRTHSEX) ) +
stat_count(geom="text", aes(label=..count..), vjust= -.1) +
scale_fill_manual( values = c( "MALES"="darkgrey", "FEMALES"="#006cc5"), guide = "none" )+
theme_538() +
xlab("Age Bands")+ ylab("Counts")
#Alternative View, if Birth Sex by Age is desired
CrossTable(SURVEY$AGE, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 200
##
##
## | SURVEY$BIRTHSEX
## SURVEY$AGE | F | M | Row Total |
## -------------|-----------|-----------|-----------|
## < 30 | 9 | 7 | 16 |
## | 0.091 | 0.069 | |
## -------------|-----------|-----------|-----------|
## 30-34 | 80 | 75 | 155 |
## | 0.808 | 0.743 | |
## -------------|-----------|-----------|-----------|
## 35-40 | 10 | 18 | 28 |
## | 0.101 | 0.178 | |
## -------------|-----------|-----------|-----------|
## 41-50 | 0 | 1 | 1 |
## | 0.000 | 0.010 | |
## -------------|-----------|-----------|-----------|
## Column Total | 99 | 101 | 200 |
## | 0.495 | 0.505 | |
## -------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 3.677372 d.f. = 3 p = 0.2984756
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.2661718
##
##
#SJPlot cross tabulation with Chi-Square/df
plot_xtab(SURVEY$RACE, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Race Distribution by Birth Sex",
axis.titles = c('Race Categories '),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
SUBSET2 <-
SURVEY %>%
filter( !is.na(RACE)) %>%
mutate(BIRTHSEX = recode_factor( BIRTHSEX, "M" = "MALES", "F" = "FEMALES", .ordered=T))
ggplot( SUBSET2, aes(x= RACE)) + facet_grid( SUBSET2$BIRTHSEX ) +
geom_bar(aes(fill= BIRTHSEX) ) +
stat_count(geom="text", aes(label=..count..), vjust= -.05) +
scale_fill_manual( values = c( "MALES"="darkgrey", "FEMALES"="#006cc5"), guide = "none" )+
theme_538() +
xlab("Race/Ethnicity Categories")+ ylab("Counts")
#Alternative View, if Birth Sex by Race is desired
CrossTable(SURVEY$RACE, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r = F, prop.t=F, chisq=T, fisher=F) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 200
##
##
## | SURVEY$BIRTHSEX
## SURVEY$RACE | F | M | Row Total |
## -------------|-----------|-----------|-----------|
## ASIAN EAST | 19 | 11 | 30 |
## | 0.192 | 0.109 | |
## -------------|-----------|-----------|-----------|
## ASIAN SOUTH | 29 | 21 | 50 |
## | 0.293 | 0.208 | |
## -------------|-----------|-----------|-----------|
## BLACK | 5 | 5 | 10 |
## | 0.051 | 0.050 | |
## -------------|-----------|-----------|-----------|
## HISPANIC | 8 | 5 | 13 |
## | 0.081 | 0.050 | |
## -------------|-----------|-----------|-----------|
## WHITE | 32 | 53 | 85 |
## | 0.323 | 0.525 | |
## -------------|-----------|-----------|-----------|
## OTHER | 6 | 6 | 12 |
## | 0.061 | 0.059 | |
## -------------|-----------|-----------|-----------|
## Column Total | 99 | 101 | 200 |
## | 0.495 | 0.505 | |
## -------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 9.274804 d.f. = 5 p = 0.09859255
##
##
##
#SJPlot cross tabulation with Chi-Square/df
plot_xtab(SURVEY$TRAINING_LEVEL, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Training Levels by Birth Sex",
axis.titles = c('Training Levels'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Training Level is desired
CrossTable(SURVEY$TRAINING_LEVEL, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=F) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 199
##
##
## | SURVEY$BIRTHSEX
## SURVEY$TRAINING_LEVEL | F | M | Row Total |
## ----------------------|-----------|-----------|-----------|
## First Year | 40 | 32 | 72 |
## | 0.404 | 0.320 | |
## ----------------------|-----------|-----------|-----------|
## Second Year | 34 | 26 | 60 |
## | 0.343 | 0.260 | |
## ----------------------|-----------|-----------|-----------|
## Third Year | 20 | 36 | 56 |
## | 0.202 | 0.360 | |
## ----------------------|-----------|-----------|-----------|
## Avanced | 5 | 6 | 11 |
## | 0.051 | 0.060 | |
## ----------------------|-----------|-----------|-----------|
## Column Total | 99 | 100 | 199 |
## | 0.497 | 0.503 | |
## ----------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 6.613035 d.f. = 3 p = 0.0853097
##
##
##
#SJPlot cross tabulation with Chi-Square/df
plot_xtab(SURVEY$HEIGHT2, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Height Bands by Birth Sex",
axis.titles = c('Height Bands'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
SUBSET2 <-
SURVEY %>%
filter( !is.na(HEIGHT2)) %>%
mutate(BIRTHSEX = recode_factor( BIRTHSEX, "M" = "MALES", "F" = "FEMALES", .ordered=T))
ggplot( SUBSET2, aes(x= HEIGHT2)) + facet_grid( SUBSET2$BIRTHSEX ) +
geom_bar(aes(fill= BIRTHSEX) ) +
stat_count(geom="text", aes(label=..count..), vjust= -.3) +
scale_fill_manual( values = c( "MALES"="darkgrey", "FEMALES"="#006cc5"), guide = "none" )+
theme_538() +
xlab("Height Bands")+ ylab("Counts")
#Alternative View, if Birth Sex by Height is desired
CrossTable(SURVEY$HEIGHT2, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r = F, prop.t=F, chisq=T, fisher=F) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 199
##
##
## | SURVEY$BIRTHSEX
## SURVEY$HEIGHT2 | F | M | Row Total |
## ---------------|-----------|-----------|-----------|
## < 5' | 1 | 0 | 1 |
## | 0.010 | 0.000 | |
## ---------------|-----------|-----------|-----------|
## 5-5'3 | 33 | 2 | 35 |
## | 0.337 | 0.020 | |
## ---------------|-----------|-----------|-----------|
## 5'4-5'6 | 40 | 9 | 49 |
## | 0.408 | 0.089 | |
## ---------------|-----------|-----------|-----------|
## 5'7-5'9 | 23 | 34 | 57 |
## | 0.235 | 0.337 | |
## ---------------|-----------|-----------|-----------|
## 5'10-6' | 1 | 34 | 35 |
## | 0.010 | 0.337 | |
## ---------------|-----------|-----------|-----------|
## 6'1-6'4 | 0 | 21 | 21 |
## | 0.000 | 0.208 | |
## ---------------|-----------|-----------|-----------|
## > 6'4 | 0 | 1 | 1 |
## | 0.000 | 0.010 | |
## ---------------|-----------|-----------|-----------|
## Column Total | 98 | 101 | 199 |
## | 0.492 | 0.508 | |
## ---------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 103.2847 d.f. = 6 p = 5.173731e-20
##
##
##
require(ggstatsplot)
#SJPlot cross tabulation with Chi-Square/df
plot_xtab(SURVEY$GLOVE, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Glove Size by Birth Sex",
axis.titles = c('Glove Sizes'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Glove Size is desired
CrossTable(SURVEY$GLOVE, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 195
##
##
## | SURVEY$BIRTHSEX
## SURVEY$GLOVE | F | M | Row Total |
## -------------|-----------|-----------|-----------|
## 5 | 1 | 0 | 1 |
## | 0.010 | 0.000 | |
## -------------|-----------|-----------|-----------|
## 5.5 | 7 | 0 | 7 |
## | 0.073 | 0.000 | |
## -------------|-----------|-----------|-----------|
## 6 | 24 | 0 | 24 |
## | 0.250 | 0.000 | |
## -------------|-----------|-----------|-----------|
## 6.5 | 48 | 6 | 54 |
## | 0.500 | 0.061 | |
## -------------|-----------|-----------|-----------|
## 7 | 14 | 31 | 45 |
## | 0.146 | 0.313 | |
## -------------|-----------|-----------|-----------|
## 7.5 | 2 | 49 | 51 |
## | 0.021 | 0.495 | |
## -------------|-----------|-----------|-----------|
## 8 | 0 | 10 | 10 |
## | 0.000 | 0.101 | |
## -------------|-----------|-----------|-----------|
## 8.5 | 0 | 3 | 3 |
## | 0.000 | 0.030 | |
## -------------|-----------|-----------|-----------|
## Column Total | 96 | 99 | 195 |
## | 0.492 | 0.508 | |
## -------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 127.3866 d.f. = 7 p = 2.208597e-24
##
##
##
#Median Glove Size - Sex Difference
SURVEY %>%
group_by( BIRTHSEX) %>%
summarize( GLOVE_MEDIAN = median(GLOVE, na.rm=T))
## # A tibble: 2 × 2
## BIRTHSEX GLOVE_MEDIAN
## <fct> <dbl>
## 1 F 6.5
## 2 M 7.5
ggbetweenstats( data= SURVEY,
x = BIRTHSEX,
y = GLOVE,
type="nonparametric",
p.adjust.method = "none")
SURVEY %>%
filter( !is.na(GLOVE) ) %>%
ggplot(aes( x=GLOVE, y= stat(density), fill= BIRTHSEX))+
geom_density( alpha=0.5, position = "identity" ) +
scale_x_continuous(breaks = scales::breaks_width(0.5) ) +
scale_y_continuous(breaks = scales::breaks_width(.25))+
scale_fill_manual(values = c("red","darkgreen"), name ="Birth Sex", labels = c("Female","Male"))+
xlab("Glove Size")+ ylab("Density")+
ggtitle("Glove Size Density Curve by Sex", subtitle = "Shows F/M distributions are almost identical, just off by one full size") +
theme_538()
#SJPlot cross tabulation with Chi-Square/df
plot_xtab(SURVEY$PERFORMANCE_HOURS, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Performance Hours by Birth Sex",
axis.titles = c('Performance Hour Bands'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Performance Hours is desired
CrossTable(SURVEY$PERFORMANCE_HOURS, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 199
##
##
## | SURVEY$BIRTHSEX
## SURVEY$PERFORMANCE_HOURS | F | M | Row Total |
## -------------------------|-----------|-----------|-----------|
## < 10 | 22 | 26 | 48 |
## | 0.224 | 0.257 | |
## -------------------------|-----------|-----------|-----------|
## 10-20 | 48 | 45 | 93 |
## | 0.490 | 0.446 | |
## -------------------------|-----------|-----------|-----------|
## 21-30 | 19 | 23 | 42 |
## | 0.194 | 0.228 | |
## -------------------------|-----------|-----------|-----------|
## 31-40 | 7 | 5 | 12 |
## | 0.071 | 0.050 | |
## -------------------------|-----------|-----------|-----------|
## > 40 | 2 | 2 | 4 |
## | 0.020 | 0.020 | |
## -------------------------|-----------|-----------|-----------|
## Column Total | 98 | 101 | 199 |
## | 0.492 | 0.508 | |
## -------------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 1.099417 d.f. = 4 p = 0.8943647
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.9059433
##
##
#SJPlot cross tabulation with Chi-Square/df
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TEACHER_GENDER_PREFERENCE, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Teacher Sex Preference by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Teacher Sex Pref?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#SJPlot cross tabulation with Chi-Square/df
plot_xtab(SURVEY$FEMALE_TRAINERS, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Number of Female Trainers by Birth Sex",
axis.titles = c('Approx. Female Trainers'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Number of Female Trainers is desired
CrossTable(SURVEY$FEMALE_TRAINERS, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 200
##
##
## | SURVEY$BIRTHSEX
## SURVEY$FEMALE_TRAINERS | F | M | Row Total |
## -----------------------|-----------|-----------|-----------|
## None | 2 | 1 | 3 |
## | 0.020 | 0.010 | |
## -----------------------|-----------|-----------|-----------|
## 1-2 | 8 | 8 | 16 |
## | 0.081 | 0.079 | |
## -----------------------|-----------|-----------|-----------|
## 3-5 | 42 | 36 | 78 |
## | 0.424 | 0.356 | |
## -----------------------|-----------|-----------|-----------|
## 6-10 | 38 | 38 | 76 |
## | 0.384 | 0.376 | |
## -----------------------|-----------|-----------|-----------|
## > 10 | 9 | 18 | 27 |
## | 0.091 | 0.178 | |
## -----------------------|-----------|-----------|-----------|
## Column Total | 99 | 101 | 200 |
## | 0.495 | 0.505 | |
## -----------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 3.775249 d.f. = 4 p = 0.4372761
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.4349633
##
##
plot_xtab(SURVEY$MALE_TRAINERS, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Number of Male Trainers by Birth Sex",
axis.titles = c('Approx. Male Trainers'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Number of Male Trainers is desired
CrossTable(SURVEY$MALE_TRAINERS, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 200
##
##
## | SURVEY$BIRTHSEX
## SURVEY$MALE_TRAINERS | F | M | Row Total |
## ---------------------|-----------|-----------|-----------|
## 1-2 | 0 | 2 | 2 |
## | 0.000 | 0.020 | |
## ---------------------|-----------|-----------|-----------|
## 3-5 | 6 | 9 | 15 |
## | 0.061 | 0.089 | |
## ---------------------|-----------|-----------|-----------|
## 6-10 | 47 | 47 | 94 |
## | 0.475 | 0.465 | |
## ---------------------|-----------|-----------|-----------|
## > 10 | 46 | 43 | 89 |
## | 0.465 | 0.426 | |
## ---------------------|-----------|-----------|-----------|
## Column Total | 99 | 101 | 200 |
## | 0.495 | 0.505 | |
## ---------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 2.681392 d.f. = 3 p = 0.4433988
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.5466762
##
##
#SJPlot cross tabulation with Chi-Square/df
plot_xtab( SURVEY$BIRTHSEX, SURVEY$EXPERIENCED_TRANSIENT_PAIN_HAND, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Transient Pain in Hand after Procedure by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Hand Pain?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$EXPERIENCED_TRANSIENT_PAIN_NECK_SHOULDER, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Transient Pain in Neck/Shoulder after Procedure by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Neck/Should Pain?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX,SURVEY$EXPERIENCED_TRANSIENT_PAIN_BACK, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Transient Pain in Back after Procedure by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Back Pain?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$EXPERIENCED_TRANSIENT_PAIN_LEG, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Transient Pain in Leg after Procedure by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Leg Pain?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$EXPERIENCED_TRANSIENT_PAIN_FOOT, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Transient Pain in Foot after Procedure by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Foot Pain?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#SJPlot cross tabulation with Chi-Square/df
SUBSET <- sqldf( "select BIRTHSEX,
GROWING_PAINS
from SURVEY
where GROWING_PAINS != 'NA' ")
SUBSET <- SUBSET %>%
mutate(GROWING_PAINS = recode_factor( GROWING_PAINS, "N" = "N",
"Y" = "Y")) %>% droplevels()
plot_xtab(SUBSET$BIRTHSEX, SUBSET$GROWING_PAINS, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Told Injuries were Growing Pains by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Growing Pains?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$FELLOWSHIP_FORMAL_ERGO_TRAINING, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Formal Ergo Training by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Formal Ergo Traiing?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab( SURVEY$BIRTHSEX, SURVEY$INFORMAL_TRAINING,margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Informal Ergo Training by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Informal Ergo Training?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_POSTURAL, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Training on Postural Awareness by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Training Postural Awareness?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_BEDHEIGHT, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Training on Bed Height Adjustments by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Training Bed Height?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_BEDANGLE, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Training on Bed Angle Adjustments by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Training Bed Angle?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_MONITORHEIGHT, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Training on Monitor Height Adjustments by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Training Monitor Height?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_MUSCULOSKELETAL, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Training on Musculoskeletal Maneuvers by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Training Musculoskeletal?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_EXERCISE_STRETCHING, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Training on Exercise/Stretching by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Training Exer/Stretch?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab( SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_DIAL_EXTENDERS,margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Training on Dial Extenders by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Training Dial Ext?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TRAINING_TECHNIQUES_PEDIATRIC_COLONOSCOPE, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Training on Pediatric Colonoscopes by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Traiing Pedi Coloscope?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$ERGO_TRAINING_BUDGET, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Ergonomic Training Budget by Birth Sex",
axis.titles = c('Ergonomic Training Budget?'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Ergo Training Budget is desired
CrossTable(SURVEY$ERGO_TRAINING_BUDGET, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 200
##
##
## | SURVEY$BIRTHSEX
## SURVEY$ERGO_TRAINING_BUDGET | F | M | Row Total |
## ----------------------------|-----------|-----------|-----------|
## Y | 2 | 0 | 2 |
## | 0.020 | 0.000 | |
## ----------------------------|-----------|-----------|-----------|
## N | 24 | 31 | 55 |
## | 0.242 | 0.307 | |
## ----------------------------|-----------|-----------|-----------|
## DK | 73 | 70 | 143 |
## | 0.737 | 0.693 | |
## ----------------------------|-----------|-----------|-----------|
## Column Total | 99 | 101 | 200 |
## | 0.495 | 0.505 | |
## ----------------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 2.93414 d.f. = 2 p = 0.2306002
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.2478861
##
##
plot_xtab(SURVEY$ERGO_FEEDBACK, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Ergo Feedback Frequency by Birth Sex",
axis.titles = c('How Frequently Ergo Feedback?'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Ergo Feedback Frequency is desired
CrossTable(SURVEY$ERGO_FEEDBACK, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 200
##
##
## | SURVEY$BIRTHSEX
## SURVEY$ERGO_FEEDBACK | F | M | Row Total |
## ---------------------|-----------|-----------|-----------|
## Never | 2 | 4 | 6 |
## | 0.020 | 0.040 | |
## ---------------------|-----------|-----------|-----------|
## Rarely | 29 | 39 | 68 |
## | 0.293 | 0.386 | |
## ---------------------|-----------|-----------|-----------|
## Sometimes | 55 | 49 | 104 |
## | 0.556 | 0.485 | |
## ---------------------|-----------|-----------|-----------|
## Often | 13 | 9 | 22 |
## | 0.131 | 0.089 | |
## ---------------------|-----------|-----------|-----------|
## Column Total | 99 | 101 | 200 |
## | 0.495 | 0.505 | |
## ---------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 3.191001 d.f. = 3 p = 0.3631037
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.3735388
##
##
plot_xtab(SURVEY$ERGO_FEEDBACK_BY_WHOM, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Who Provides Ergo Feedback by Birth Sex",
axis.titles = c('Who Provides Feedback?'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Ergo Feedback by Whom is desired
CrossTable(SURVEY$ERGO_FEEDBACK_BY_WHOM, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 200
##
##
## | SURVEY$BIRTHSEX
## SURVEY$ERGO_FEEDBACK_BY_WHOM | F | M | Row Total |
## --------------------------------|-----------|-----------|-----------|
## Do not/rarely received feedback | 10 | 17 | 27 |
## | 0.101 | 0.168 | |
## --------------------------------|-----------|-----------|-----------|
## Mostly male teachers | 16 | 19 | 35 |
## | 0.162 | 0.188 | |
## --------------------------------|-----------|-----------|-----------|
## Mostly female teachers | 18 | 15 | 33 |
## | 0.182 | 0.149 | |
## --------------------------------|-----------|-----------|-----------|
## Both equally | 55 | 50 | 105 |
## | 0.556 | 0.495 | |
## --------------------------------|-----------|-----------|-----------|
## Column Total | 99 | 101 | 200 |
## | 0.495 | 0.505 | |
## --------------------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 2.563036 d.f. = 3 p = 0.4640066
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.4709419
##
##
plot_xtab( SURVEY$BIRTHSEX, SURVEY$ERGO_OPTIMIZATION, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Ergonomically Optimized Equipment by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Ergo Optimization?",
geom.colors = c("#006cc5", "lightblue", "#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$GLOVE_SIZE_AVAILABLE, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Glove Size Availability by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Glove Size Avail?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$DIAL_EXTENDERS_AVAILABLE, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Dial Extender Availability by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Dial Ext Avail?",
geom.colors = c("#006cc5","lightblue", "#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
SUBSET <- sqldf( "select BIRTHSEX,
DIAL_EXTENDERS_ENCOURAGED
from SURVEY
where DIAL_EXTENDERS_ENCOURAGED != 'DU' ")
SUBSET <- SUBSET %>%
mutate(DIAL_EXTENDERS_ENCOURAGED = recode_factor( DIAL_EXTENDERS_ENCOURAGED, "N" = "N",
"Y" = "Y")) %>% droplevels()
plot_xtab(SUBSET$BIRTHSEX, SUBSET$DIAL_EXTENDERS_ENCOURAGED, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Dial Extenders Encouraged by Birth Sex - (Includes only subjects who use Dial Extenders)",
axis.titles = "Birth Sex",
legend.title= "Dial Ext Encouraged?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
SUBSET <- sqldf( "select BIRTHSEX,
DIAL_EXTENDERS_FEMALEATT
from SURVEY
where DIAL_EXTENDERS_FEMALEATT != 'NA' ")
SUBSET <- SUBSET %>%
mutate(DIAL_EXTENDERS_FEMALEATT = recode_factor( DIAL_EXTENDERS_FEMALEATT, "N" = "N",
"Y" = "Y")) %>% droplevels()
plot_xtab(SUBSET$BIRTHSEX, SUBSET$DIAL_EXTENDERS_FEMALEATT, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Dial Extenders Encouraged with Female Att by Birth Sex - (Includes only subjects who use Dial Extenders)",
axis.titles = "Birth Sex",
legend.title= "Dial Ext FemAtt?",
geom.colors = c("#006cc5","lightblue", "#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
SUBSET <- sqldf( "select BIRTHSEX,
DIAL_EXTENDERS_MALEATT
from SURVEY
where DIAL_EXTENDERS_MALEATT != 'NA' ")
SUBSET <- SUBSET %>%
mutate(DIAL_EXTENDERS_MALEATT = recode_factor( DIAL_EXTENDERS_MALEATT, "N" = "N",
"Y" = "Y")) %>% droplevels()
plot_xtab(SUBSET$BIRTHSEX, SUBSET$DIAL_EXTENDERS_MALEATT, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Dial Extenders Encouraged with Male Att by Birth Sex - (Includes only subjects who use Dial Extenders)",
axis.titles = "Birth Sex",
legend.title= "Dial Ext MaleAtt?",
geom.colors = c("#006cc5","lightblue", "#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$PEDI_COLONOSCOPES_AVAILABLE, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Pediatric Colonoscopes by Birth Sex",
axis.titles = c('Pedi Colonoscopes Available?'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Pedi Colonoscopes is desired
CrossTable(SURVEY$PEDI_COLONOSCOPES_AVAILABLE, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 199
##
##
## | SURVEY$BIRTHSEX
## SURVEY$PEDI_COLONOSCOPES_AVAILABLE | F | M | Row Total |
## -----------------------------------|-----------|-----------|-----------|
## Y | 93 | 100 | 193 |
## | 0.949 | 0.990 | |
## -----------------------------------|-----------|-----------|-----------|
## N | 2 | 0 | 2 |
## | 0.020 | 0.000 | |
## -----------------------------------|-----------|-----------|-----------|
## DK | 3 | 1 | 4 |
## | 0.031 | 0.010 | |
## -----------------------------------|-----------|-----------|-----------|
## Column Total | 98 | 101 | 199 |
## | 0.492 | 0.508 | |
## -----------------------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 3.209389 d.f. = 2 p = 0.2009509
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.178596
##
##
plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_DONTKNOW, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Don't Know Whether Lead Aprons Available at Institution by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Aware of Lead Aprons?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab( SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_LW_ONEPIECE,margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Lead Aprons LW One-Piece Available at Institution by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Lead Aprons LW 1P?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_LW_TWOPIECE, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Lead Aprons LW Two-Piece Available at Institution by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Lead Aprons LW 2P?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_STANDARD_ONEPIECE, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Lead Aprons SW One-Piece Available at Institution by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Lead Aprons Std 1P?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_STANDARD_TWOPIECE, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Lead Aprons SW Two-Piece Available at Institution by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Lead Aprons Std 2P?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_DOUBLE, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Lead Aprons Double Lead (Maternity) Available at Institution by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Lead Aprons Double?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_THYROID, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Lead Aprons Thyroid Shield Available at Institution by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Lead Aprons Thyroid?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_MATERNALDOS, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Lead Aprons Maternal Dosimeter Available at Institution by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Lead Aprons Maternal?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$LEAD_APRONS_FETALDOS, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Lead Aprons Fetal Dosimeter Available at Institution by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Lead Aprons Fetal?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$ERGO_FORMAL_TIMEOUT_PRIOR, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Formal Ergo Timeouts at Institution by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Formal Ergo Timeout?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$ERGO_INFORMAL_TIMEOUT_PRIOR, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Informal Ergo Timeouts at Institution by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Informal Ergo Timeout?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab( SURVEY$BIRTHSEX, SURVEY$MONITORS_ADJUSTABLE,margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Monitors Easily Adjustable at Institution by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Monitors Easily Adjust?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TEACHER_SENSITIVITY_STATURE_HANDSIZE, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Teachers Train with Sensitivity to Stature/Hand Size by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Teacher Sensitivity to Stature?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$TEACHER_SENSITIVITY_BY_GENDER, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Sex of Sensitive Teachers by Birth Sex",
axis.titles = c('Male or Female Teachers More Sensitive?'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Male or Female Teacher more Sensitive is desired
CrossTable(SURVEY$TEACHER_SENSITIVITY_BY_GENDER, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 198
##
##
## | SURVEY$BIRTHSEX
## SURVEY$TEACHER_SENSITIVITY_BY_GENDER | F | M | Row Total |
## -------------------------------------|-----------|-----------|-----------|
## Male | 6 | 7 | 13 |
## | 0.061 | 0.070 | |
## -------------------------------------|-----------|-----------|-----------|
## Female | 22 | 9 | 31 |
## | 0.224 | 0.090 | |
## -------------------------------------|-----------|-----------|-----------|
## Both Equally | 48 | 61 | 109 |
## | 0.490 | 0.610 | |
## -------------------------------------|-----------|-----------|-----------|
## Never had female teacher | 3 | 1 | 4 |
## | 0.031 | 0.010 | |
## -------------------------------------|-----------|-----------|-----------|
## Not Sure | 19 | 22 | 41 |
## | 0.194 | 0.220 | |
## -------------------------------------|-----------|-----------|-----------|
## Column Total | 98 | 100 | 198 |
## | 0.495 | 0.505 | |
## -------------------------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 8.27915 d.f. = 4 p = 0.08187149
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.07371324
##
##
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TACTILE_INSTRUCTION_FROM_MALES, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Tactile Instruction from Male Teachers by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Tactile Instruction from Males?",
geom.colors = c("#006cc5","lightblue", "#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$TACTILE_INSTRUCTION_FROM_FEMALES, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Tactile Instruction from Females Teachers by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Tactile Instruction from Females?",
geom.colors = c("#006cc5","lightblue", "#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$COMFORTABLE_ASKING_NURSES, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Comfortable Asking Nurses for Help by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Comfortable Asking Nurses?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
SUBSET <- sqldf( "select BIRTHSEX,
COMFORTABLE_ASKING_TECHS
from SURVEY
where COMFORTABLE_ASKING_TECHS != 'NA' ")
SUBSET <- SUBSET %>%
mutate(COMFORTABLE_ASKING_TECHS = recode_factor( COMFORTABLE_ASKING_TECHS, "N" = "N",
"Y" = "Y")) %>% droplevels()
plot_xtab(SUBSET$BIRTHSEX, SUBSET$COMFORTABLE_ASKING_TECHS, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Comfortable Asking Techs for Help by Birth Sex (Includes only respondents with Techs)",
axis.titles = "Birth Sex",
legend.title= "Comfortable Asking Techs?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab( SURVEY$BIRTHSEX, SURVEY$NURSES_ASKING, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Times Asking Nurses for Help by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Times Asking Nurses?",
geom.colors = c("#006cc5", "lightblue", "#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$MALE_ATTENDINGS_ASKING, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Times Male Attending Asking Nurses for Help by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Times Asking MaleAtt?",
geom.colors = c("#006cc5", "lightblue", "#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$FEMALE_ATTENDINGS_ASKING, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Times Female Attending Asking Nurses for Help by Birth Sex",
axis.titles = c('Times Female Att Asking Nurses?'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Times Asking Female Attending is desired
CrossTable(SURVEY$FEMALE_ATTENDINGS_ASKING, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 193
##
##
## | SURVEY$BIRTHSEX
## SURVEY$FEMALE_ATTENDINGS_ASKING | F | M | Row Total |
## --------------------------------|-----------|-----------|-----------|
## Once | 37 | 40 | 77 |
## | 0.394 | 0.404 | |
## --------------------------------|-----------|-----------|-----------|
## Twice | 23 | 27 | 50 |
## | 0.245 | 0.273 | |
## --------------------------------|-----------|-----------|-----------|
## More than Twice | 31 | 31 | 62 |
## | 0.330 | 0.313 | |
## --------------------------------|-----------|-----------|-----------|
## Don't work with FemAtt | 3 | 1 | 4 |
## | 0.032 | 0.010 | |
## --------------------------------|-----------|-----------|-----------|
## Column Total | 94 | 99 | 193 |
## | 0.487 | 0.513 | |
## --------------------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 1.308227 d.f. = 3 p = 0.7271803
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.7653168
##
##
plot_xtab(SURVEY$BIRTHSEX, SURVEY$RECOGNIZED_RESPECTED_ES_STAFF, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Recognized/Respected by ES Staff by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Recog by ES Staff?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$RECOGNIZED_RESPECTED_ANESTHETISTS, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Recognized/Respected by Anesthetists by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Recog by Anesthetists?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab( SURVEY$BIRTHSEX, SURVEY$RECOGNIZED_RESPECTED_GASTRO_ATTENDING,margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Recognized/Respected by Gastro Attending by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Recog by Gastro Att?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$FIRST_NAME_NO_PERMISSION, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "First Name Used No Permission by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "First Name No Permission?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Is there a RACE difference on this question ?
plot_xtab(SURVEY$RACE2, SURVEY$FIRST_NAME_NO_PERMISSION, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "First Name Used No Permission by Race (Broad)",
axis.titles = "Binary Race Category",
legend.title= "First Name Used No Permission?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Is there a TRAINING LEVEL difference on this question ?
plot_xtab(SURVEY$TRAINING_LEVEL, SURVEY$FIRST_NAME_NO_PERMISSION, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "First Name Used No Permission by Training Level",
axis.titles = "Binary Race Category",
legend.title= "First Name Used No Permission?",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$ERGO_TRAINING_MANDATORY, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Should Ergo Training be Mandaotry by Birth Sex",
axis.titles = c('Mandatory Ergo Training?'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Ergo Training be Mandatory is desired
CrossTable(SURVEY$ERGO_TRAINING_MANDATORY, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F , prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 198
##
##
## | SURVEY$BIRTHSEX
## SURVEY$ERGO_TRAINING_MANDATORY | F | M | Row Total |
## -------------------------------|-----------|-----------|-----------|
## Y | 98 | 96 | 194 |
## | 0.990 | 0.970 | |
## -------------------------------|-----------|-----------|-----------|
## N | 0 | 1 | 1 |
## | 0.000 | 0.010 | |
## -------------------------------|-----------|-----------|-----------|
## DK | 1 | 2 | 3 |
## | 0.010 | 0.020 | |
## -------------------------------|-----------|-----------|-----------|
## Column Total | 99 | 99 | 198 |
## | 0.500 | 0.500 | |
## -------------------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 1.353952 d.f. = 2 p = 0.5081513
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.6211636
##
##
plot_xtab(SURVEY$ERGO_OPTIMIZAITON_BUDGET_REQUIRED, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Should Budget Include Ergo Optimiation by Birth Sex",
axis.titles = c('Budget Should Include Ergo Opti?'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Ergo Optimization Budget be Mandatory is desired
CrossTable(SURVEY$ERGO_OPTIMIZAITON_BUDGET_REQUIRED, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 198
##
##
## | SURVEY$BIRTHSEX
## SURVEY$ERGO_OPTIMIZAITON_BUDGET_REQUIRED | F | M | Row Total |
## -----------------------------------------|-----------|-----------|-----------|
## Y | 95 | 89 | 184 |
## | 0.960 | 0.899 | |
## -----------------------------------------|-----------|-----------|-----------|
## N | 0 | 3 | 3 |
## | 0.000 | 0.030 | |
## -----------------------------------------|-----------|-----------|-----------|
## DK | 4 | 7 | 11 |
## | 0.040 | 0.071 | |
## -----------------------------------------|-----------|-----------|-----------|
## Column Total | 99 | 99 | 198 |
## | 0.500 | 0.500 | |
## -----------------------------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 4.013834 d.f. = 2 p = 0.1344024
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.1342971
##
##
plot_xtab(SURVEY$BIRTHSEX, SURVEY$EXPERIENCE_IMPROVED_DIAL_EXTENDERS, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Increased Availability of Dial Extenders by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Increase Avail Dial Ext?",
geom.colors = c("#006cc5","lightblue", "#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$EXPERIENCE_IMPROVED_PEDI_COLONOSCOPES, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Increased Availability of Pedi Colonoscopes by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Increase Avail Pediscopes?",
geom.colors = c("#006cc5","lightblue", "#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$EXPERIENCE_IMPROVED_APRONS, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Increased Availability of Lead Aprons by Birth Sex",
axis.titles = "Birth Sex",
legend.title= "Improve Aprons?",
geom.colors = c("#006cc5","lightblue", "#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED, SURVEY$BIRTHSEX, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Formal Ergo Training Required for Teachers by Birth Sex",
axis.titles = c('Ergo Training Required for Teachers?'),
legend.title= "Birth Sex",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
#Alternative View, if Birth Sex by Formal Teacher Training Mandatory is desired
CrossTable(SURVEY$ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED, SURVEY$BIRTHSEX, prop.chisq=F, prop.c=T, prop.r=F, prop.t=F, chisq=T, fisher=T) #rows then/over columns
##
##
## Cell Contents
## |-------------------------|
## | N |
## | N / Col Total |
## |-------------------------|
##
##
## Total Observations in Table: 198
##
##
## | SURVEY$BIRTHSEX
## SURVEY$ENDO_TEACHERS_FORMAL_TRAINING_REQUIRED | F | M | Row Total |
## ----------------------------------------------|-----------|-----------|-----------|
## Y | 90 | 91 | 181 |
## | 0.909 | 0.919 | |
## ----------------------------------------------|-----------|-----------|-----------|
## N | 1 | 3 | 4 |
## | 0.010 | 0.030 | |
## ----------------------------------------------|-----------|-----------|-----------|
## DK | 8 | 5 | 13 |
## | 0.081 | 0.051 | |
## ----------------------------------------------|-----------|-----------|-----------|
## Column Total | 99 | 99 | 198 |
## | 0.500 | 0.500 | |
## ----------------------------------------------|-----------|-----------|-----------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 1.697833 d.f. = 2 p = 0.4278784
##
##
##
## Fisher's Exact Test for Count Data
## ------------------------------------------------------------
## Alternative hypothesis: two.sided
## p = 0.4998525
##
##
plot_xtab(SURVEY$BIRTHSEX, SURVEY$ERGONOMIC_IMPORTANCE, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Importance of Ergonomics in Relation to ERI",
axis.titles = "Birth Sex",
legend.title= "Ergo Importance Response",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$MITIGATING_MUSCLE_STRAIN, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Mitigation Strategies to Reduce Muscle Strain Risk",
axis.titles = "Birth Sex",
legend.title= "Muscle Strain Response",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$BED_POSITION, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Bed Position in Relation to the Elbow",
axis.titles = "Birth Sex",
legend.title= "Bed Position Response",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$ENDO_TRAINER_POSITION, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Best Position for Endoscopy Trainer",
axis.titles = "Birth Sex",
legend.title= "Trainer Position Response",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
plot_xtab(SURVEY$BIRTHSEX, SURVEY$WHEN_DISABILITY_INSURANCE, margin = "row",
bar.pos = "stack", coord.flip = TRUE,
title = "Best Time to Explore Disability Insurance",
axis.titles = "Birth Sex",
legend.title= "When Disab Ins Response",
geom.colors = c("#006cc5","#cbcccb"),
show.summary = TRUE )+
set_theme(base= theme_classic())
# CORRECT <-
#
# SURVEY %>%
# mutate(CORRECT = across(.cols = ERGONOMIC_IMPORTANCE: WHEN_DISABILITY_INSURANCE , .fns = str_count, "Correct")) %>%
# rowwise() %>%
# mutate(COUNT_CORRECT = across(.cols = contains("Correct"), .fns = sum)) %>%
# select (BIRTHSEX, ERGONOMIC_IMPORTANCE: WHEN_DISABILITY_INSURANCE, COUNT_CORRECT) %>%
# mutate( COUNT_CORRECT = as.integer(COUNT_CORRECT) )
# CORRECT <-
# SURVEY %>%
# select (BIRTHSEX, ERGONOMIC_IMPORTANCE: WHEN_DISABILITY_INSURANCE,) %>%
# mutate( COUNT_CORRECT = apply( . , 1, function(x) sum( x== "Correct", na.rm= T )))
CORRECT <-
SURVEY %>%
select (BIRTHSEX, ERGONOMIC_IMPORTANCE: WHEN_DISABILITY_INSURANCE,) %>%
mutate( COUNT_CORRECT = rowSums( . == "Correct" ))
eov.ttest(CORRECT, COUNT_CORRECT, BIRTHSEX)
## [1] "F Test p.value = 0.7562784 EOV = TRUE (Pooled)"
## [1] "CORRECT : COUNT_CORRECT ~ BIRTHSEX"
##
## Two Sample t-test
##
## data: CORRECT : COUNT_CORRECT ~ BIRTHSEX
## t = 0.98604, df = 198, p-value = 0.3253
## alternative hypothesis: true difference in means between group F and group M is not equal to 0
## 95 percent confidence interval:
## -0.1672054 0.5016388
## sample estimates:
## mean in group F mean in group M
## 3.444444 3.277228
ggbetweenstats( data= CORRECT,
x = BIRTHSEX,
y = COUNT_CORRECT,
type="parametric",
p.adjust.method = "none",
title = "Mean Scores by Birth Sex")
PAIN <-
SURVEY %>%
mutate( BIRTHSEX2 = case_when( BIRTHSEX == "M" ~ 0,
TRUE ~ 1 ),
PAIN_INJ = case_when (EVER_INJURED == 'Y' ~ 1,
TRUE ~ 0 ),
PAIN_HAND = case_when (EXPERIENCED_TRANSIENT_PAIN_HAND == "Y" ~ 1,
TRUE ~ 0),
PAIN_NECK = case_when (EXPERIENCED_TRANSIENT_PAIN_NECK_SHOULDER == "Y" ~ 1,
TRUE ~ 0),
PAIN_BACK = case_when (EXPERIENCED_TRANSIENT_PAIN_BACK == "Y" ~ 1,
TRUE ~ 0),
PAIN_LEG = case_when (EXPERIENCED_TRANSIENT_PAIN_LEG == "Y" ~ 1,
TRUE ~ 0),
PAIN_FOOT = case_when (EXPERIENCED_TRANSIENT_PAIN_FOOT == "Y" ~ 1,
TRUE ~ 0)) %>%
rowwise() %>%
mutate(PAIN_SCORE = sum(PAIN_INJ+ PAIN_HAND+ PAIN_NECK+ PAIN_BACK + PAIN_LEG+ PAIN_FOOT)) %>%
select( RECORD_ID, BIRTHSEX, BIRTHSEX2, RACE, RACE2, TRAINING_LEVEL, EVER_INJURED, starts_with("PAIN_") )
# Test for normality of distribution (will be sensitive to outliers)
shapiro.test(PAIN$PAIN_SCORE)
##
## Shapiro-Wilk normality test
##
## data: PAIN$PAIN_SCORE
## W = 0.8912, p-value = 7.166e-11
# Group Means & Standard Deviations
PAIN %>%
group_by(BIRTHSEX) %>%
summarize( PAINMEAN = mean(PAIN_SCORE),
PAINSD = sd(PAIN_SCORE))
## # A tibble: 2 × 3
## BIRTHSEX PAINMEAN PAINSD
## <fct> <dbl> <dbl>
## 1 F 2.24 1.39
## 2 M 1.76 1.31
# Welch's T-test
eov.ttest(PAIN, PAIN_SCORE, BIRTHSEX)
## [1] "F Test p.value = 0.5902336 EOV = TRUE (Pooled)"
## [1] "PAIN : PAIN_SCORE ~ BIRTHSEX"
##
## Two Sample t-test
##
## data: PAIN : PAIN_SCORE ~ BIRTHSEX
## t = 2.5156, df = 198, p-value = 0.01268
## alternative hypothesis: true difference in means between group F and group M is not equal to 0
## 95 percent confidence interval:
## 0.1037302 0.8563658
## sample estimates:
## mean in group F mean in group M
## 2.242424 1.762376
# Violin Plot to explore differences between sexes
ggbetweenstats( data= PAIN,
x = BIRTHSEX,
y = PAIN_SCORE,
type="parametric",
p.adjust.method = "none",
title = "Mean Pain/Injury Scores by Birth Sex")
corr.test( PAIN$BIRTHSEX2,PAIN$PAIN_SCORE, method= 'pearson')
## Call:corr.test(x = PAIN$BIRTHSEX2, y = PAIN$PAIN_SCORE, method = "pearson")
## Correlation matrix
## [1] 0.18
## Sample Size
## [1] 200
## These are the unadjusted probability values.
## The probability values adjusted for multiple tests are in the p.adj object.
## [1] 0.01
##
## To see confidence intervals of the correlations, print with the short=FALSE option
# CREATE TRAINING INDEX
TRAINING <-
SURVEY %>%
mutate( BIRTHSEX2 = case_when( BIRTHSEX == "M" ~ 0,
TRUE ~ 1 ),
TRNG_FORMAL = case_when (FELLOWSHIP_FORMAL_ERGO_TRAINING == 'Y' ~ 1,
TRUE ~ 0 ),
TRNG_INFORMAL = case_when (INFORMAL_TRAINING == "Y" ~ 1,
TRUE ~ 0),
TRNG_POSTURAL = case_when (TRAINING_TECHNIQUES_POSTURAL == "Y" ~ 1,
TRUE ~ 0),
TRNG_BEDHT = case_when (TRAINING_TECHNIQUES_BEDHEIGHT == "Y" ~ 1,
TRUE ~ 0),
TRNG_BEDANG = case_when (TRAINING_TECHNIQUES_BEDANGLE == "Y" ~ 1,
TRUE ~ 0),
TRNG_MONITOR = case_when (TRAINING_TECHNIQUES_MONITORHEIGHT == "Y" ~ 1,
TRUE ~ 0),
TRNG_MANEUVERS = case_when (TRAINING_TECHNIQUES_MUSCULOSKELETAL == "Y" ~ 1,
TRUE ~ 0) ,
TRNG_EXERCISE = case_when (TRAINING_TECHNIQUES_EXERCISE_STRETCHING == "Y" ~ 1,
TRUE ~ 0),
TRNG_DIALEXT= case_when (TRAINING_TECHNIQUES_DIAL_EXTENDERS == "Y" ~ 1,
TRUE ~ 0),
TRNG_PEDISCOPE= case_when (TRAINING_TECHNIQUES_PEDIATRIC_COLONOSCOPE == "Y" ~ 1,
TRUE ~ 0),
TRNG_FEEDBACK= case_when (ERGO_FEEDBACK == "Often" ~ 3,
ERGO_FEEDBACK == "Sometimes" ~ 2,
ERGO_FEEDBACK == "Rarely" ~ 1,
TRUE ~ 0),
TRNG_OPTIM= case_when (ERGO_OPTIMIZATION == "Y" ~ 1,
ERGO_OPTIMIZATION == "N" ~ 0,
TRUE ~ 0),
TRNG_GLOVE_AVAIL = case_when (GLOVE_SIZE_AVAILABLE == "Y" ~ 1,
TRUE ~ 0),
TRNG_DIALEXT_AVAIL= case_when (DIAL_EXTENDERS_AVAILABLE == "Y" ~ 1,
TRUE ~ 0),
TRNG_DIALEXT_ENC= case_when (DIAL_EXTENDERS_ENCOURAGED == "Y" ~ 1,
TRUE ~ 0),
TRNG_PEDISCOPE_AVAIL = case_when (PEDI_COLONOSCOPES_AVAILABLE == "Y" ~ 1,
TRUE ~ 0),
TRNG_FITTED_APRON_AVAIL = case_when (LEAD_APRONS_DONTKNOW == "Aware" ~ 1,
TRUE ~ 0),
TRNG_TO_FORMAL= case_when (ERGO_FORMAL_TIMEOUT_PRIOR == "Y" ~ 1,
TRUE ~ 0),
TRNG_TO_INFORMAL= case_when (ERGO_INFORMAL_TIMEOUT_PRIOR == "Y" ~ 1,
TRUE ~ 0),
TRNG_MONITORS_EASYADJ = case_when (MONITORS_ADJUSTABLE == "Y" ~ 1,
TRUE ~ 0),
TRNG_TRAINERS_SENSITIVITY = case_when (TEACHER_SENSITIVITY_STATURE_HANDSIZE == "Y" ~ 1,
TRUE ~ 0),
TRNG_TACTILE_MALES = case_when (TACTILE_INSTRUCTION_FROM_MALES == "Often" ~ 2,
TACTILE_INSTRUCTION_FROM_MALES == "Rarely" ~ 1,
TRUE ~ 0),
TRNG_TACTILE_FEMALES = case_when (TACTILE_INSTRUCTION_FROM_FEMALES == "Often" ~ 2,
TACTILE_INSTRUCTION_FROM_FEMALES == "Rarely" ~ 1,
TRUE ~ 0)) %>%
rowwise() %>%
mutate(RECORD_ID, TRNG_SCORE = sum(TRNG_FORMAL+ TRNG_INFORMAL+ TRNG_POSTURAL+ TRNG_BEDHT+ +TRNG_BEDANG+ TRNG_MONITOR+ TRNG_MANEUVERS+ TRNG_EXERCISE+ TRNG_DIALEXT+
TRNG_PEDISCOPE+ TRNG_FEEDBACK+ TRNG_OPTIM+ TRNG_GLOVE_AVAIL+ TRNG_DIALEXT_AVAIL+ TRNG_DIALEXT_ENC+ TRNG_PEDISCOPE_AVAIL+
TRNG_FITTED_APRON_AVAIL+ TRNG_TO_FORMAL+ TRNG_TO_INFORMAL+ TRNG_MONITORS_EASYADJ + TRNG_TRAINERS_SENSITIVITY+
TRNG_TACTILE_MALES+ TRNG_TACTILE_FEMALES)) %>%
select( BIRTHSEX, BIRTHSEX2, RACE, RACE2, TRAINING_LEVEL, starts_with("TRNG_") )
TRAINING %>%
group_by(BIRTHSEX) %>%
summarize( TRNGMEAN = mean(TRNG_SCORE),
TRNGSD = sd(TRNG_SCORE))
## # A tibble: 2 × 3
## BIRTHSEX TRNGMEAN TRNGSD
## <fct> <dbl> <dbl>
## 1 F 14.2 4.35
## 2 M 14.2 3.82
shapiro.test(TRAINING$TRNG_SCORE)
##
## Shapiro-Wilk normality test
##
## data: TRAINING$TRNG_SCORE
## W = 0.9854, p-value = 0.03661
eov.ttest(TRAINING, TRNG_SCORE, BIRTHSEX)
## [1] "F Test p.value = 0.1984335 EOV = TRUE (Pooled)"
## [1] "TRAINING : TRNG_SCORE ~ BIRTHSEX"
##
## Two Sample t-test
##
## data: TRAINING : TRNG_SCORE ~ BIRTHSEX
## t = 0.042135, df = 198, p-value = 0.9664
## alternative hypothesis: true difference in means between group F and group M is not equal to 0
## 95 percent confidence interval:
## -1.117694 1.166499
## sample estimates:
## mean in group F mean in group M
## 14.23232 14.20792
ggbetweenstats( data= TRAINING,
x = BIRTHSEX,
y = TRNG_SCORE,
type="parametric",
p.adjust.method = "none",
title = "Mean Training Scores by Birth Sex")
corr.test( TRAINING$BIRTHSEX2,TRAINING$TRNG_SCORE, method= 'pearson', ci=T)
## Call:corr.test(x = TRAINING$BIRTHSEX2, y = TRAINING$TRNG_SCORE, method = "pearson",
## ci = T)
## Correlation matrix
## [1] 0
## Sample Size
## [1] 200
## These are the unadjusted probability values.
## The probability values adjusted for multiple tests are in the p.adj object.
## [1] 0.97
##
## To see confidence intervals of the correlations, print with the short=FALSE option
# BIRTHSEX predicting PAIN_SCORE
summary(lm(PAIN_SCORE ~ BIRTHSEX , data = SCORES))
##
## Call:
## lm(formula = PAIN_SCORE ~ BIRTHSEX, data = SCORES)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.2424 -0.7624 -0.2424 0.7576 4.2376
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.2424 0.1356 16.536 <2e-16 ***
## BIRTHSEXM -0.4800 0.1908 -2.516 0.0127 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.349 on 198 degrees of freedom
## Multiple R-squared: 0.03097, Adjusted R-squared: 0.02608
## F-statistic: 6.328 on 1 and 198 DF, p-value: 0.01268
# BIRTHSEX predicting PAIN_SCORE when controlled for EQUIP_SCORE
summary(lm(PAIN_SCORE ~ BIRTHSEX + EQUIP_SCORE , data = SCORES))
##
## Call:
## lm(formula = PAIN_SCORE ~ BIRTHSEX + EQUIP_SCORE, data = SCORES)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.5319 -0.8456 -0.3252 0.6403 4.0166
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.80743 0.32120 8.740 1.02e-15 ***
## BIRTHSEXM -0.41076 0.19286 -2.130 0.0344 *
## EQUIP_SCORE -0.13777 0.07111 -1.938 0.0541 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.34 on 197 degrees of freedom
## Multiple R-squared: 0.04909, Adjusted R-squared: 0.03944
## F-statistic: 5.085 on 2 and 197 DF, p-value: 0.007025
# BIRTHSEX predicting PAIN_SCORE when controlled for EQUIP_SCORE & AGEBAND
summary(lm(PAIN_SCORE ~ BIRTHSEX + EQUIP_SCORE + AGE2 , data = SCORES))
##
## Call:
## lm(formula = PAIN_SCORE ~ BIRTHSEX + EQUIP_SCORE + AGE2, data = SCORES)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.5167 -0.9219 -0.2434 0.6794 4.1207
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.02387 0.43377 4.666 5.72e-06 ***
## BIRTHSEXM -0.38818 0.19156 -2.026 0.04409 *
## EQUIP_SCORE -0.14869 0.07016 -2.119 0.03534 *
## AGE230-34 0.93884 0.34707 2.705 0.00744 **
## AGE235-40 0.68964 0.41527 1.661 0.09838 .
## AGE2> 40 -0.89226 1.36433 -0.654 0.51389
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.319 on 194 degrees of freedom
## Multiple R-squared: 0.0929, Adjusted R-squared: 0.06953
## F-statistic: 3.974 on 5 and 194 DF, p-value: 0.001872
anova(lm(PAIN_SCORE ~ BIRTHSEX + EQUIP_SCORE + AGE2 , data = SCORES))
## Analysis of Variance Table
##
## Response: PAIN_SCORE
## Df Sum Sq Mean Sq F value Pr(>F)
## BIRTHSEX 1 11.52 11.5212 6.6237 0.01081 *
## EQUIP_SCORE 1 6.74 6.7410 3.8755 0.05042 .
## AGE2 3 16.30 5.4328 3.1234 0.02706 *
## Residuals 194 337.44 1.7394
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# COMPARE how M/F PAIN_SCORE means differ in unadjusted and fully adjusted model
library(emmeans)
#unadjusted model
pscore.unadj <- emmeans(lm(PAIN_SCORE ~ BIRTHSEX , data = SCORES), specs= "BIRTHSEX")
summary(pscore.unadj)
## BIRTHSEX emmean SE df lower.CL upper.CL
## F 2.24 0.136 198 1.98 2.51
## M 1.76 0.134 198 1.50 2.03
##
## Confidence level used: 0.95
contrast(pscore.unadj, list(FvM = c(1,-1)))
## contrast estimate SE df t.ratio p.value
## FvM 0.48 0.191 198 2.516 0.0127
#fully adjusted model
pscore.adj <- emmeans(lm(PAIN_SCORE ~ BIRTHSEX + EQUIP_SCORE + AGE2 , data = SCORES), specs= "BIRTHSEX")
summary(pscore.adj)
## BIRTHSEX emmean SE df lower.CL upper.CL
## F 1.56 0.367 194 0.836 2.28
## M 1.17 0.354 194 0.475 1.87
##
## Results are averaged over the levels of: AGE2
## Confidence level used: 0.95
contrast(pscore.adj, list(FvM = c(1,-1)))
## contrast estimate SE df t.ratio p.value
## FvM 0.388 0.192 194 2.026 0.0441
##
## Results are averaged over the levels of: AGE2
#Compare all combinations of BIRTHSEX-AGE2 to see if any sliver is significantly different (after Benjamini-Hochberg correction for multiple comparisons)
pscore.adj2 <- emmeans(lm(PAIN_SCORE ~ BIRTHSEX + EQUIP_SCORE + AGE2 , data = SCORES), specs= c("BIRTHSEX","AGE2"))
summary(pscore.adj2)
## BIRTHSEX AGE2 emmean SE df lower.CL upper.CL
## F < 30 1.3763 0.342 194 0.702 2.05
## M < 30 0.9882 0.346 194 0.305 1.67
## F 30-34 2.3152 0.141 194 2.038 2.59
## M 30-34 1.9270 0.145 194 1.641 2.21
## F 35-40 2.0660 0.278 194 1.517 2.61
## M 35-40 1.6778 0.258 194 1.168 2.19
## F > 40 0.4841 1.332 194 -2.143 3.11
## M > 40 0.0959 1.320 194 -2.507 2.70
##
## Confidence level used: 0.95
pairs(pscore.adj2, adjust="bh", type="response")
## contrast estimate SE df t.ratio p.value
## F < 30 - M < 30 0.388 0.192 194 2.026 0.1375
## F < 30 - (F 30-34) -0.939 0.347 194 -2.705 0.0694
## F < 30 - (M 30-34) -0.551 0.394 194 -1.397 0.2961
## F < 30 - (F 35-40) -0.690 0.415 194 -1.661 0.2296
## F < 30 - (M 35-40) -0.301 0.442 194 -0.682 0.5534
## F < 30 - F > 40 0.892 1.364 194 0.654 0.5534
## F < 30 - M > 40 1.280 1.364 194 0.938 0.4606
## M < 30 - (F 30-34) -1.327 0.399 194 -3.329 0.0292
## M < 30 - (M 30-34) -0.939 0.347 194 -2.705 0.0694
## M < 30 - (F 35-40) -1.078 0.472 194 -2.283 0.1375
## M < 30 - (M 35-40) -0.690 0.415 194 -1.661 0.2296
## M < 30 - F > 40 0.504 1.391 194 0.362 0.7174
## M < 30 - M > 40 0.892 1.364 194 0.654 0.5534
## (F 30-34) - (M 30-34) 0.388 0.192 194 2.026 0.1375
## (F 30-34) - (F 35-40) 0.249 0.273 194 0.914 0.4606
## (F 30-34) - (M 35-40) 0.637 0.315 194 2.025 0.1375
## (F 30-34) - F > 40 1.831 1.327 194 1.380 0.2961
## (F 30-34) - M > 40 2.219 1.328 194 1.672 0.2296
## (M 30-34) - (F 35-40) -0.139 0.351 194 -0.396 0.7174
## (M 30-34) - (M 35-40) 0.249 0.273 194 0.914 0.4606
## (M 30-34) - F > 40 1.443 1.354 194 1.066 0.4240
## (M 30-34) - M > 40 1.831 1.327 194 1.380 0.2961
## (F 35-40) - (M 35-40) 0.388 0.192 194 2.026 0.1375
## (F 35-40) - F > 40 1.582 1.344 194 1.177 0.3745
## (F 35-40) - M > 40 1.970 1.349 194 1.460 0.2961
## (M 35-40) - F > 40 1.194 1.366 194 0.874 0.4667
## (M 35-40) - M > 40 1.582 1.344 194 1.177 0.3745
## F > 40 - M > 40 0.388 0.192 194 2.026 0.1375
##
## P value adjustment: BH method for 28 tests
#FINDING:
#In the fully-adjusted model, of the 28 possible SEX/AGEBAND combinations, the one that is statistically significant - and survives a correction for multiple comparisons - is "Males < 30" versus "Females 30-34." Here the Females' mean is 1.327 points higher than the Males', p=0.0292. (The F-M differential for entire adjusted model was only 0.388 points.)
#Since Females 30-34 have the highest adjusted Pain Score, how does that score compare to the mean Pain Score of ALL OTHER RESPONDENTS?
# Mean for Females 30-34
contrast( pscore.adj2, list(F3034 = c(0,0,1,0,0,0,0,0)))
## contrast estimate SE df t.ratio p.value
## F3034 2.32 0.141 194 16.478 <.0001
#Mean for Everyone Else
contrast( pscore.adj2, list(OTHERS = c(1/7, 1/7, 0, 1/7, 1/7, 1/7, 1/7, 1/7)))
## contrast estimate SE df t.ratio p.value
## OTHERS 1.23 0.396 194 3.111 0.0021
#Contast Females 30-34 relative to all other respondents
contrast( pscore.adj2, list("Females 30-34 rel to Others" = c(-1/7, -1/7, 1, -1/7, -1/7, -1/7, -1/7, -1/7)))
## contrast estimate SE df t.ratio p.value
## Females 30-34 rel to Others 1.08 0.412 194 2.630 0.0092
# EQUIP_SCORE predicting PAIN_SCORE when controlled for BIRTHSEX & TRAINING_LEVEL & AGEBAND
# Should Equipment Score be the "outcome of interest"? (In other words, EQUIP_SCORE observed after controlling for Sex and Training Level ... or Age?)
summary(lm(PAIN_SCORE ~ EQUIP_SCORE + BIRTHSEX + TRAINING_LEVEL , data = SCORES))
##
## Call:
## lm(formula = PAIN_SCORE ~ EQUIP_SCORE + BIRTHSEX + TRAINING_LEVEL,
## data = SCORES)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.7255 -0.9307 -0.2374 0.6145 4.0087
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.01906 0.52468 5.754 3.37e-08 ***
## EQUIP_SCORE -0.14802 0.07086 -2.089 0.0380 *
## BIRTHSEXM -0.39413 0.19492 -2.022 0.0446 *
## TRAINING_LEVELFirst Year -0.45299 0.43239 -1.048 0.2961
## TRAINING_LEVELSecond Year 0.15054 0.43733 0.344 0.7311
## TRAINING_LEVELThird Year -0.18955 0.44016 -0.431 0.6672
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.329 on 193 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.08083, Adjusted R-squared: 0.05702
## F-statistic: 3.394 on 5 and 193 DF, p-value: 0.005809
anova(lm(PAIN_SCORE ~ EQUIP_SCORE + BIRTHSEX + TRAINING_LEVEL , data = SCORES))
## Analysis of Variance Table
##
## Response: PAIN_SCORE
## Df Sum Sq Mean Sq F value Pr(>F)
## EQUIP_SCORE 1 9.91 9.9144 5.6113 0.01883 *
## BIRTHSEX 1 7.85 7.8490 4.4423 0.03635 *
## TRAINING_LEVEL 3 12.22 4.0749 2.3063 0.07802 .
## Residuals 193 341.01 1.7669
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# CREATE RESPECT INDEX
RESPECT <-
SURVEY %>%
mutate( BIRTHSEX2 = case_when( BIRTHSEX == "M" ~ 0,
TRUE ~ 1 ),
RESPECT_NURSES = case_when (COMFORTABLE_ASKING_NURSES == 'Y' ~ 1,
TRUE ~ 0 ),
RESPECT_TECHS = case_when (COMFORTABLE_ASKING_TECHS == "Y" ~ 1,
TRUE ~ 0),
RESPECT_NFREQ = case_when (NURSES_ASKING == "More than Twice" ~ 3,
NURSES_ASKING == "Twice" ~ 2,
NURSES_ASKING == "Once" ~ 1,
TRUE ~ 0),
RESPECT_ESTAFF = case_when (RECOGNIZED_RESPECTED_ES_STAFF == "Y" ~ 1,
TRUE ~ 0),
RESPECT_ANES = case_when (RECOGNIZED_RESPECTED_ANESTHETISTS == "Y" ~ 1,
TRUE ~ 0),
RESPECT_GIATT = case_when (RECOGNIZED_RESPECTED_GASTRO_ATTENDING == "Y" ~ 1,
TRUE ~ 0),
RESPECT_FNAME = case_when (FIRST_NAME_NO_PERMISSION == "Y" ~ 1,
TRUE ~ 0)) %>%
rowwise() %>%
mutate(RESPECT_SCORE = sum( RESPECT_NURSES + RESPECT_TECHS + RESPECT_NFREQ + RESPECT_ESTAFF + RESPECT_ANES +
RESPECT_GIATT + RESPECT_FNAME)) %>%
select( BIRTHSEX, BIRTHSEX2, AGE2, RACE, RACE2, TRAINING_LEVEL, EVER_INJURED, starts_with("RESPECT_") )
RESPECT %>%
group_by(BIRTHSEX) %>%
summarize( RSPECTMEAN = mean(RESPECT_SCORE),
RSPECTSD = sd(RESPECT_SCORE))
## # A tibble: 2 × 3
## BIRTHSEX RSPECTMEAN RSPECTSD
## <fct> <dbl> <dbl>
## 1 F 6.46 1.47
## 2 M 6.70 1.43
shapiro.test(RESPECT$RESPECT_SCORE)
##
## Shapiro-Wilk normality test
##
## data: RESPECT$RESPECT_SCORE
## W = 0.90094, p-value = 2.886e-10
eov.ttest(RESPECT, RESPECT_SCORE, BIRTHSEX)
## [1] "F Test p.value = 0.8156612 EOV = TRUE (Pooled)"
## [1] "RESPECT : RESPECT_SCORE ~ BIRTHSEX"
##
## Two Sample t-test
##
## data: RESPECT : RESPECT_SCORE ~ BIRTHSEX
## t = -1.163, df = 198, p-value = 0.2462
## alternative hypothesis: true difference in means between group F and group M is not equal to 0
## 95 percent confidence interval:
## -0.6424462 0.1657986
## sample estimates:
## mean in group F mean in group M
## 6.464646 6.702970
eov.ttest(RESPECT, RESPECT_SCORE, RACE2)
## [1] "F Test p.value = 0.6842362 EOV = TRUE (Pooled)"
## [1] "RESPECT : RESPECT_SCORE ~ RACE2"
##
## Two Sample t-test
##
## data: RESPECT : RESPECT_SCORE ~ RACE2
## t = -0.16972, df = 198, p-value = 0.8654
## alternative hypothesis: true difference in means between group WHITE and group NON-WHITE is not equal to 0
## 95 percent confidence interval:
## -0.4453844 0.3747961
## sample estimates:
## mean in group WHITE mean in group NON-WHITE
## 6.564706 6.600000
ggbetweenstats( data= RESPECT,
x = BIRTHSEX,
y = RESPECT_SCORE,
type="parametric",
p.adjust.method = "none",
title = "Mean RESPECT Scores by Birth Sex")